home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
RTPC10
/
DISKSUM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-20
|
3KB
|
77 lines
{
┌────────┬──────────────────────────────────────────────────────┐
│Name │ DISKSUM.PAS │
├────────┼──────────────────────────────────────────────────────┤
│Use │ Just an example program for TP6 and above. │
│ │ Lists all the files on current drive. │
├────────┼──────────────────────────────────────────────────────┤
│By │ Rafe Aldridge - (C) Copyright 1993 │
└────────┴──────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────┐
│ Please realise that this program present's an idea. No claim │
│ is made that it is well written or cannot be improved upon │
└───────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────┐
│ Rafe's TP Collection is SHAREWARE │
├───────────────────────────────────────────────────────────────┤
│ │
│ If you find any part of Rafe's TP Collection usefull then │
│ please become a registered user by sending 10 Pounds Sterling │
│ to the address below. In return you will recieve the LATEST │
│ FULL source code to ALL the units as well anything new. │
│ │
│ Please feel free to write with suggestions, ideas or money to │
│ Rafe Aldridge, │
│ Street Farm, │
│ Dereham Road, │
│ Garvestone, │
│ Norfolk. │
│ NR9 4QT │
│ ENGLAND │
│ │
└───────────────────────────────────────────────────────────────┘
}
uses Dos;
var
NoOfFiles : word;
NoOfDirec : word;
procedure DirList (DirToList : string); { recursive procedure that lists files }
var
DirInfo: SearchRec;
begin
FindFirst(DirToList+'*.*', Anyfile, DirInfo);
while DosError = 0 do
begin
Write (DirToList+DirInfo.Name+' ');
write (dirinfo.attr:8);
if (((DirInfo.Attr) and (Directory))=0) then { is it a directory ? }
begin
WriteLn; { no }
Inc (NoOfFiles,1);
end
else
begin
WriteLn (' - DIRECTORY '); { yes - is it . or .. ? }
if (DirInfo.Name<>'.') and (DirInfo.Name<>'..') then { yes }
begin
Inc (NoOfDirec,1);
DirList (DirToList+DirInfo.Name+'\'); { recurse }
end
end;
FindNext(DirInfo); { get next file }
end;
end;
begin
NoOfFiles:=0; { reset number of files }
DirList ('\'); { start list at root }
WriteLn;
Write (NoOfFiles:0,' Files Found in '); { display number of files }
Writeln (NoOfDirec:0,' Directories.');
end.